package kino;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import com.modeliosoft.modelio.javadesigner.annotations.objid;

public class Vorstellung {
    @objid ("83c546ea-7737-11e1-9cce-0024d7607540")
    public List<Film> Filme = new ArrayList<Film> ();

    @objid ("29f97a0a-7738-11e1-9cce-0024d7607540")
    public Saal Saal;

    @objid ("4fca0294-7738-11e1-9cce-0024d7607540")
    public Programm Programm;

    @objid ("9759e972-8a1a-11e1-a315-0024d7607540")
    private Timestamp start;

    @objid ("9759e973-8a1a-11e1-a315-0024d7607540")
    private Timestamp ende;

    @objid ("d94fb04c-94ff-11e1-b35a-0024d7607540")
    private int id;


    public Vorstellung(final List<Film> filme, final Saal saal, final Timestamp start, final Timestamp ende) {
        super();
        Filme = filme;
        Saal = saal;
        this.start = start;
        this.ende = ende;
    }

    public String toString() {
        String ausgabe="Vorstellungen vom " + start + " bis zum " + ende + "\n________________________________________________";
        Iterator<Film> itr1 = Filme.iterator();
        int help=0;
        while(itr1.hasNext()){
            ausgabe= ausgabe + "\nFilm "+ ++help +": " + itr1.next();
        }
        return ausgabe;
    }

    public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

    public Vorstellung(final Film film, final Saal saal, final Timestamp start, final Timestamp ende) {
        super();
        Filme.add(film);
        Saal = saal;
        this.start = start;
        this.ende = ende;
    }

}
